<template>
	<view class="qualificationInformationShop">
		<view class="top">
			行业类目
			<text>{{data.info.industryName}}</text>
		</view>
		<view class="qualifications">
			<view class="idCart" v-if="data.isCart">
				身份证
				<view class="bot">
					<view class="" v-if="data.info.certFrontFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certFrontFile"
								mode="aspectFill"></image>
						</view>
						身份证人像面
					</view>
					<view class="" v-if="data.info.certBackFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certBackFile"
								mode="aspectFill"></image>
						</view>
						身份证国徽面
					</view>
				</view>

			</view>
			<view class="yyzz" v-if="data.info.mainType.value == 'COMPANY' && !data.isCart">
				营业执照({{data.info.licenceFile?1:0}}/1)
				<view class="">
					<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.licenceFile" mode="aspectFill">
					</image>
				</view>
			</view>
			<view class="xgzz" v-if="data.info.mainType.value == 'COMPANY' && !data.isCart">
				相关资质({{data.info.otherLicence.length || 0}}/20)
				<view class="">
					<view class="" v-for="(item,index) in data.info.otherLicence" :key="index">
						<image :src="data.httpUrl+'/app/file/viewFile?fileId='+item" mode="aspectFill"></image>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { myStoreDetail } from '@/utils/api/shop'
	import { reactive } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	const data = reactive<any>({
		info: '',
		httpUrl: getApp().globalData.baseUrl,
		isCart:''
	})
	onLoad(({isCart})=>{
		data.isCart = isCart;
	})
	myStoreDetail().then((res) => {
		res.data.storeInfoDetail.otherLicence = JSON.parse(res.data.storeInfoDetail.otherLicence)
		data.info = res.data.storeInfoDetail;
	})
</script>

<style lang="scss">
	.qualificationInformationShop {
		height: 100vh;
		background: #F4F6FA;
		padding-top: 24rpx;
		>.top{
			padding: 27rpx 32rpx;
			border-radius: 24rpx;
			margin: 0 24rpx;
			background: #fff;
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #595959;
			text{
				font-size: 32rpx;
			}
		}
	}

	.qualifications {
		color: #8C8C8C;
		padding: 0 24rpx;
		margin-top: 24rpx;

		image {
			width: 100%;
			height: 100%;
		}

		.idCart {
			padding: 24rpx 32rpx;
			border-radius: 20rpx;
			background: #fff;
			margin-top: 20rpx;

			.bot {
				display: flex;
				justify-content: space-between;

				>view {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					width: 300rpx;
					font-size: 24rpx;
					color: #8C8C8C;
					margin-top: 16rpx;

					view {
						border-radius: 20rpx;
						background: #ccc;
						height: 180rpx;
						margin-bottom: 8rpx;
						width: 100%;

					}
				}
			}


		}

		.yyzz {
			padding: 24rpx 32rpx;
			border-radius: 20rpx;
			background: #fff;
			margin-top: 20rpx;

			view {
				height: 240rpx;
				margin-top: 20rpx;
				border-radius: 20rpx;
				border: 2rpx dashed #F4F6FA;
			}
		}

		.xgzz {
			padding: 24rpx 32rpx;
			border-radius: 20rpx;
			background: #fff;
			margin-top: 20rpx;

			>view {
				display: flex;
				flex-wrap: wrap;

				view {
					height: 200rpx;
					width: 32%;
					background: #ccc;
					margin-top: 16rpx;
					border-radius: 12rpx;
					margin-right: 2%;
				}

				>view:nth-of-type(3n) {
					margin-right: 0;
				}
			}
		}
	}
</style>